<template>
  <div class="container">
    <div class="contl">
      <p>项目负责人</p>
      <div class="cont">
        <div class="item" v-for="(item,index) in userdata" :key="index">
          <div v-if="item.users.length>0">
            <h6>{{item.workflow_node.title}}</h6>
            <h6 v-for="(items,indexs) in item.users" :key="indexs">{{items.name}}</h6>
          </div>
        </div>
      </div>
    </div>

    <div class="contr">
      <p>结果文件</p>
      <div class="items" v-for="(item,index) in resultdata" :key="index">
        <div>
          <p>{{item.title}}</p>
          <a :href="item.url" target="blank">下载</a>
        </div>
      </div>  
    </div>
  </div>
</template>

<script>
import store from '@/vuex/store.js'
export default {
  data () {
    return {
      userdata:[],
      resultdata:[]
    }
  },
  store,
  mounted () {
    this.$api.Project.show(sessionStorage.getItem('reslutid')).then(res=>{
      console.log(res)
      this.userdata = res.data.data.nodes
      this.resultdata = res.data.data.last_node.attachments
    })
    store.commit('changeactive', 2)
  },
}
</script>

<style lang='scss' scoped>
  .container{
    width: calc(100% - 20px);
    margin-left: 20px;
    height: 100%;
    font-size: 14px;
    color: #515151;
    display: flex;
    .contl{
      width: 50%;
      >p{
        margin-bottom: 20px;
      }
      .cont{
        display: flex;
        flex-wrap: wrap;
        .item{
          width: 50%;
          margin-bottom: 30px;
          h6{
            margin-bottom: 10px;
          }
        }
      }
    }
    .contr{
      width: 50%;
      >p{
        font-size: 16px;
        margin-bottom: 10px;
      }
      .items{
        >div {
          display: flex;
          align-items: center;
          justify-content: space-between;
          p{
            line-height: 46px;
          }
          a{
            width: 200px;
            height: 38px;
            background: #56AFF7;
            color: #fff;
            text-align: center;
            line-height: 38px;
            opacity: 0;
            cursor: pointer;
            text-decoration: none;
          }
          &:hover a{
            opacity: 1;
          }
        }
      }
    }
  }
</style>